import { createRouter, createWebHistory } from 'vue-router'
import routes from './routes/index'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    ...routes,
    {
      path: '/welcome',
      name: 'welcome',
      component: import('@/views/welcome.vue')
    },
    {
      path: '/404',
      name: '404',
      component: () => import('@/views/error/404.vue')
    },
    // {
    //   path: "/without-permission",
    //   component: () => import("@/views/error-page/withoutPermission.vue"),
    // },
    { path: '/', redirect: '/home' },
    { path: '/:pathMatch(.*)', redirect: '/404' }
  ]
})

export default router
